﻿using FwtXnaGame3.Common;
using GpgCore.GameWorld;

namespace GpgCore.Corporations
{
    public class Corporation
    {
        public static SmartList<Corporation> CorpRegister
        {
            get { return World.Instance.Planet.Government.AllCorporations.Corporations; }
        }

        public string Name;
        public SmartDictionary<City, CityOffice> CityOffices;

        public CityOffice OpenOfficeInCity(City city)
        {
            if (CityOffices.ContainsKey(city))
                return CityOffices[city];

            var office = new CityOffice(this, city);
            CityOffices.Insert(city, office);
            return office;
        }

        public Corporation()
        {
            CityOffices = new SmartDictionary<City, CityOffice>();
            CorpRegister.Add(this);
        }
    }
}
